package it.uniroma3.dia.ia.textcategorization.persistence;

import java.io.InputStream;

/**
 * 
 * This interface declares the methods of the objects used
 * by TexCat to manage the persistence of Text instances.
 * 
 * @author Marco Liceti.
 *
 */
public interface TextPersistenceManager {
	
	/**
	 * 
	 * Saves a Text instance.
	 * 
	 * @param text The content of the Text instance to save, given as an InputStream object.
	 * @return a String identifier for the saved Text.
	 * 
	 */
	String saveText(InputStream text);
	
	/**
	 * 
	 * Loads a Text instance.
	 * 
	 * @param textId the String identifier of the Text instance to load.
	 * @return the content of the Text instance to load, as an InputStream object.
	 */
	InputStream loadText(String textId);
	
	/**
	 * 
	 * Deletes a Text instance.
	 * 
	 * @param textId the String identifier of the Text instance to load.
	 */
	void deleteText(String textId);

}
